/*
** functions_one.c for bistromathique in /home/labonn_c//Documents/bistromathique
** 
** Made by christophe labonnemartinez
** Login   <labonn_c@epitech.net>
** 
** Started on  Mon Oct 31 08:27:44 2011 christophe labonnemartinez
** Last update Tue Nov  1 12:43:34 2011 christophe labonnemartinez
*/

void	my_putnbr_base(int nbr, char *base)
{
  int	temp;
  int	div;
  int	base_length;
  int	p;

  base_length = my_strlen(base);
  p = 1;
  div = 1;
  temp = 0;
  if (nbr < 0)
    {
      nbr = nbr * - 1;
      my_putchar('-');
    }
  while (nbr / p > base_length - 1)
    p = p * base_length;
  while (p >= 1)
    {
      temp = (temp * 10) + (base[nbr / p] - '0');
      nbr = nbr % p;
      p = p / base_length;
      my_putchar(temp + '0');
      temp = 0;
    }
}
